home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qfile.h.z / qfile.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.1 KB  |  97 lines

  1. /****************************************************************************
  2. ** $Id: qfile.h,v 2.6 1998/07/03 00:09:44 hanord Exp $
  3. **
  4. ** Definition of QFile class
  5. **
  6. ** Created : 930831
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QFILE_H
  25. #define QFILE_H
  26.  
  27. #ifndef QT_H
  28. #include "qiodevice.h"
  29. #include "qstring.h"
  30. #include <stdio.h>
  31. #endif // QT_H
  32.  
  33. class QDir;
  34.  
  35.  
  36. class QFile : public QIODevice            // file I/O device class
  37. {
  38. public:
  39.     QFile();
  40.     QFile( const char *name );
  41.    ~QFile();
  42.  
  43.     const char *name()    const;
  44.     void    setName( const char *name );
  45.  
  46.     bool    exists()   const;
  47.     static bool exists( const char *fileName );
  48.  
  49.     bool    remove();
  50.     static bool remove( const char *fileName );
  51.  
  52.     bool    open( int );
  53.     bool    open( int, FILE * );
  54.     bool    open( int, int );
  55.     void    close();
  56.     void    flush();
  57.  
  58.     uint    size()    const;
  59.     int        at()    const;
  60.     bool    at( int );
  61.     bool    atEnd() const;
  62.  
  63.     int        readBlock( char *data, uint len );
  64.     int        writeBlock( const char *data, uint len );
  65.     int        readLine( char *data, uint maxlen );
  66.  
  67.     int        getch();
  68.     int        putch( int );
  69.     int        ungetch( int );
  70.  
  71.     int        handle() const;
  72.  
  73. protected:
  74.     QString    fn;
  75.     FILE       *fh;
  76.     int        fd;
  77.     int        length;
  78.     bool    ext_f;
  79.  
  80. private:
  81.     void    init();
  82.  
  83. private:    // Disabled copy constructor and operator=
  84.     QFile( const QFile & );
  85.     QFile &operator=( const QFile & );
  86. };
  87.  
  88.  
  89. inline const char *QFile::name() const
  90. { return fn; }
  91.  
  92. inline int QFile::at() const
  93. { return index; }
  94.  
  95.  
  96. #endif // QFILE_H
  97.